home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Report Writers / Crystal Repot 9.0 Full CD version / Setup.exe / Windows / System32 / HTMLRE90.DLL / HTML / 11313 < prev    next >
Encoding:
Text File  |  2002-07-05  |  6.5 KB  |  248 lines

  1. <html>
  2.  
  3. <head>
  4.  
  5. <LINK REL="stylesheet" TYPE="text/css" HREF="%7css/default.css">
  6. </head>
  7.  
  8. <SCRIPT LANGUAGE="JavaScript">
  9.  
  10. function init()
  11. {
  12.     // Remove the formatting options
  13.     document.object_prop.targets.options[0] = null; 
  14.     document.object_prop.choices.options[0] = null; 
  15. }
  16.  
  17. function OnSubmit()
  18. {
  19.     modifyValues(); 
  20.     document.forms[0].submit(); 
  21. }
  22.  
  23. function OnCancel()
  24. {
  25.     window.parent.location = "%8" 
  26. }
  27.  
  28. function addTarget()
  29. {
  30.     // Run through this list twice, once to add, once to delete
  31.     total = document.object_prop.choices.options.length; 
  32.     for (count = 0; count < total; ++count)
  33.     {
  34.         current_target = document.object_prop.choices.options[count];
  35.             
  36.         if (current_target.selected)
  37.         {
  38.  
  39.             // remove the object from the current targets
  40.             target_name = current_target.text;
  41.             target_id   = current_target.value; 
  42.  
  43.             // Create a new option
  44.             option = new Option(target_name, target_id, false, false); 
  45.  
  46.             // add it to the possible targets
  47.             document.object_prop.targets.options[document.object_prop.targets.options.length] = option;
  48.         }
  49.     }
  50.  
  51.     for (count = document.object_prop.choices.options.length -1;  count >= 0; --count)
  52.     {
  53.         if (document.object_prop.choices.options[count].selected)
  54.             document.object_prop.choices.options[count] = null; 
  55.     }
  56. }
  57.  
  58. function addAllTargets()
  59. {
  60.     // Run through the options and remove all selections
  61.     total = document.object_prop.choices.options.length;
  62.     for (count = 0; count < total; ++count)
  63.     {
  64.         current_target = document.object_prop.choices.options[count];
  65.             
  66.         // remove the object from the current targets
  67.         target_name = current_target.text;
  68.         target_id   = current_target.value; 
  69.  
  70.         // Create a new option
  71.         option = new Option(target_name, target_id, false, false); 
  72.  
  73.         // add it to the possible targets
  74.         document.object_prop.targets.options[document.object_prop.targets.options.length] = option;
  75.     }
  76.  
  77.     // Remove old objects
  78.     document.object_prop.choices.options.length = 0; 
  79. }
  80.  
  81.  
  82.  
  83. function deleteTarget()
  84. {
  85.     
  86.     // Run through the options and remove the current selections
  87.     total = document.object_prop.targets.length;
  88.     for (count = 0; count < total; ++count)
  89.     {
  90.         current_target = document.object_prop.targets.options[count];    
  91.         if (current_target.selected)
  92.         {
  93.             // remove the object from the current targets
  94.             target_name = current_target.text;
  95.             target_id   = current_target.value; 
  96.         
  97.             // Create a new option
  98.             option = new Option(target_name, target_id, false, false); 
  99.  
  100.             // add it to the possible targets
  101.             document.object_prop.choices.options[document.object_prop.choices.options.length] = option;
  102.         }
  103.     }
  104.     for (count = total -1; count >= 0;  --count)
  105.     {
  106.         if (document.object_prop.targets.options[count].selected)
  107.         {
  108.             document.object_prop.targets.options[count] = null; 
  109.         }
  110.  
  111.     }
  112. }
  113.  
  114. function deleteAllTargets()
  115. {
  116.     // Run through the options and remove all of the selection
  117.     total = document.object_prop.targets.length;
  118.     for (count = 0; count < total; ++count)
  119.     {
  120.         current_target = document.object_prop.targets.options[count];
  121.             
  122.         // remove the object from the current targets
  123.         target_name = current_target.text;
  124.         target_id   = current_target.value; 
  125.  
  126.         // Create a new option
  127.         option = new Option(target_name, target_id, false, false); 
  128.  
  129.         // add it to the possible targets
  130.         document.object_prop.choices.options[document.object_prop.choices.options.length] = option
  131.     }
  132.     document.object_prop.targets.options.length = 0; 
  133. }
  134.  
  135. function modifyValues()
  136. {
  137.     final_value = ""; 
  138.     first = true; 
  139.  
  140.     for (count = 0; count < document.object_prop.targets.options.length; ++count)
  141.     {
  142.         if (!first)
  143.         {
  144.             final_value += "+"; 
  145.         }
  146.         else first = false; 
  147.  
  148.         current_target = document.object_prop.targets.options[count];    
  149.         final_value += current_target.value;
  150.  
  151.         // De-select all entries on the select box
  152.         current_target.selected = false;
  153.     }
  154.  
  155.     // Build the string
  156.     document.object_prop.selectedChoices.value = final_value;
  157. }
  158.  
  159. </SCRIPT>
  160.  
  161. <BODY onload="init();">
  162.  
  163. <CENTER>
  164.  
  165. <FORM action="%3" target="_parent" method="post" name="object_prop" onSubmit="modifyValues()">
  166.  
  167. <strong> %4 </strong>
  168. <BR>
  169. <BR>
  170.  
  171. <table align=center CELLPADDING="0" CELLSPACING="0" border=0 width=100%>
  172.  
  173.   <tr> 
  174.     <td class="list" colspan=2 align=left>  %5 </td>
  175.     <td class="list" align=left> %6 </td> 
  176.   </tr>
  177.  
  178.   <tr>
  179.     <td class="list" align=left>
  180.         <SELECT class="menuFormElement" multiple NAME="choices" SIZE=10 width="200px">
  181.             <OPTION> This is a formatting string </OPTION>
  182.             %1
  183.         </SELECT>
  184.     </td>
  185.     
  186.     <td>
  187.         <table> 
  188.             <tr><td align=middle>
  189.                 <table align=center CELLPADDING="0" CELLSPACING="5" border=0> 
  190.                 <tr><td class="clsButton" align=middle nowrap> 
  191.                     <div class="clsButton"><a href="javascript:addTarget()">    >    </a></div>
  192.                 </td></tr>
  193.                 </table>
  194.             </td></tr>
  195.             <tr><td align=middle>
  196.                 <table align=center CELLPADDING="0" CELLSPACING="5" border=0> 
  197.                 <tr><td class="clsButton" align=middle nowrap> 
  198.                     <div class="clsButton"><a href="javascript:addAllTargets()">   >>   </a></div>
  199.                 </td></tr>
  200.                 </table>
  201.             </td></tr>
  202.             <tr><td align=middle>
  203.                 <table align=center CELLPADDING="0" CELLSPACING="5" border=0> 
  204.                 <tr><td class="clsButton" align=middle nowrap>     
  205.                     <div class="clsButton"><a href="javascript:deleteTarget()">    <    </a></div> 
  206.                 </td></tr>
  207.                 </table>
  208.             </td></tr>
  209.             <tr><td align=middle>
  210.                 <table align=center CELLPADDING="0" CELLSPACING="5" border=0> 
  211.                 <tr><td class="clsButton" align=middle nowrap>     
  212.                     <div class="clsButton"><a href="javascript:deleteAllTargets()">   <<   </a></div>
  213.                 </td></tr>
  214.                 </table>
  215.             </td></tr>
  216.         </table>
  217.     </td>
  218.     
  219.     <td class="list" align=left>
  220.         <SELECT class="menuFormElement" multiple NAME="targets" SIZE=10 width="200px">
  221.             <OPTION> This is a formatting string </OPTION>
  222.             %2
  223.         </SELECT>
  224.     </td>
  225.     </table>
  226.  
  227. <BR>
  228.  
  229. <table align=center  CELLSPACING="5" CELLPADDING="0" border=0> 
  230.     <tr>            
  231.         <td class="clsButton" align=middle nowrap> 
  232.             <div class="clsButton"><a href="javascript:OnSubmit()">OK</a></div>
  233.         </td>
  234.  
  235.         <td class="clsButton" align=middle nowrap> 
  236.             <div class="clsButton"><a href="javascript:OnCancel()">Cancel</a></div>
  237.         </td>
  238.     <tr>
  239. </table>
  240.  
  241. <input type=hidden name="selectedChoices" value = "">
  242.  
  243. </FORM>
  244.  
  245. </CENTER>
  246. </body>
  247. </html>
  248.